/*
 * Copyright 2011 Drew Wilder-Goodwin
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef UTILITY_H_
#define UTILITY_H_

#include "resources.h"
#include <windows.h>
#include <commctrl.h>

/*
 * Convert WCHAR string to long.  Mimics strtol.
 */
LONG lstrtolW(const WCHAR * str, WCHAR ** end, int base);

/*
 * Access the MessageBoxW API with resource identifiers
 */
void messageboxw_resource(HWND handle, int textId, int captionId,
                          UINT type);

/*
 * Display a WINE_FIXME message box
 * with this error string.
 */
VOID wine_fixme(WCHAR * error);

/*
 * Get a pointer to a resource string
 */
const WCHAR *get_resource_string(int id);

/*
 * Display a WINE_FIXME message box
 * with this resource string.
 */
VOID wine_fixme_resource(int resource);

/*
 * Get a copy of a resource string
 */
WCHAR *get_loadwstring_copy(int id);

/*
 * Return an empty string if the input string is null.
 * Else, return the empty string.
 */
const WCHAR *get_safe_string(WCHAR * str);

/*
 * Compare two RECT structures and return true if they are
 * equal.
 */
BOOL rects_equal(RECT * left, RECT * right);

/*
 * Given a dialog, the ID of a control, and some text, set
 * the text of the control.
 */
VOID set_control_text(HWND hDialog, WCHAR * text, int controlId);

/*
 * Given a dialog, the ID of a control, and a resource string ID,
 * set the text of the control.
 */
VOID set_control_text_resource(HWND hDialog, UINT stringId, int controlId);

/*
 * Insert a tab into a control
 */
VOID insert_tab_resource(HWND hwnd, int stringid, TCITEMW* tie, int tabindex);

#endif                          /* UTILITY_H_ */
